import 'package:flutter/material.dart';
import 'package:my_app/uitls/global.dart';

AppBar customAppBar({
  BuildContext? context,
  String title = '',
  bool borderBottom = true,
  List<Widget>? actions,  
}) {
  return AppBar(
    centerTitle: true,
    title: Text(
      title,
      style: TextStyle(
        color: Color.fromRGBO(56, 56, 56, 1),
        fontSize: 16,
        fontWeight: FontWeight.bold,
      ),
    ),
    backgroundColor: Color(0xFFFFFFFF),
    elevation: 0,
    leading: context == null ? null : InkWell(
      child: Icon(Icons.arrow_back_ios_new),
      onTap: () => Navigator.pop(context),
    ),
    bottom: PreferredSize(
      preferredSize: Size.fromHeight(0),
      child: Container(
        decoration: BoxDecoration(
          border: G.borderBottom(show: borderBottom),
        ),
      ),
    ),
    actions: actions,
  );
}